{extend name="Public/content"/}
{block name="button"}
<button class="layui-btn layui-btn-sm" data-title="添加轮播图" data-modal="{:U('add')}">添加轮播图</button>
<button data-update data-field='delete' data-action='{:U("del")}' class='layui-btn layui-btn-sm layui-btn-danger'>删除轮播图</button>
{/block}
{block name='content'}

<!-- 表单搜索 开始 -->
<form class="layui-form layui-form-pane form-search" action="{:U()}" onsubmit="return false" method="get">

    <div class="layui-form-item layui-inline">
        <label class="layui-form-label">标题</label>
        <div class="layui-input-inline">
            <input name="title" value="{$Think.get.title|default=''}" placeholder="请输入标题" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item layui-inline">
        <button class="layui-btn layui-btn-primary"><i class="layui-icon">&#xe615;</i> 搜 索</button>
    </div>

</form>
<!-- 表单搜索 结束 -->

{empty name='list'}
<p class="help-block text-center well">没 有 记 录 哦！</p>
{else/}
<form class="layui-form" action="__SELF__" data-auto="true" method="post">
    <input type="hidden" name="action" value="resort">
    <table class="layui-table layui-form" lay-size='sm' lay-skin="line">
        <thead>
            <tr>
                <th class='list-table-check-td'>
                    <input type="checkbox" name="" lay-skin="primary" lay-filter="allChoose">
                </th>
                <th class="list-table-sort-td">
                    <button type="submit" class="layui-btn layui-btn-xs layui-btn-normal">排序</button>
                </th>
                <th class="text-left">标题</th>
                <th class="text-left">图片</th>
                <th class="text-left">链接</th>
                <th class="text-left">打开方式</th>
                <th class="text-left">创建时间</th>
                <th class="text-left">状态</th>
                <th></th>
            </tr> 
        </thead>
        <tbody>
            {volist name="list" id="vo"}
            <tr>
                <td class='list-table-check-td'>
                    <input type="checkbox" value="{$vo.id}" class="list-check-box" lay-skin="primary" lay-filter="itemChoose">
                </td>
                <td class="list-table-sort-td">
                    <input type="text" name="_{$vo.id}" value="{$vo.sort}" class="sort-input">
                </td>
                <td class="text-left">{$vo.title}</td>
                <td class="text-left"><img data-tips-image src="{$vo.img}" height="22"></td>
                <td class="text-left"><a href="{$vo.link}" target="_blank">{$vo.link}</a></td>
                <td class="text-left">{eq name='vo.target' value='_self'}当前窗口{/eq}{eq name='vo.target' value='_blank'}新窗口{/eq}</td>
                <td class="text-left">{$vo.create_at|default=''}</td>
                <td class="text-left">
                    {eq name='vo.status' value='0'}<span class="color-red">已禁用</span>{/eq}
                    {eq name='vo.status' value='1'}<span class="color-green">使用中</span>{/eq}
                </td>
                <td>
                    <a data-title="编辑轮播图" data-modal="{:U('edit')}?id={$vo.id}">编辑</a>
                    <span class="text-explode">|</span>
                    {eq name='vo.status' value='1'}
                    <a data-update="{$vo.id}" data-field='status' data-value='0' data-action='{:U("forbid")}'>禁用</a>
                    {/eq}
                    {eq name='vo.status' value='0'}
                    <a data-update="{$vo.id}" data-field='status' data-value='1' data-action='{:U("resume")}'>启用</a>
                    {/eq}
                    <span class="text-explode">|</span>
                    <a data-update="{$vo.id}" data-field="delete" data-action="{:U('del')}">删除</a>
                </td>
            </tr>
            {/volist}
        </tbody>
    </table>
</form>
{if condition="isset($page)"}<p>{$page}</p>{/if}
{/empty}
{/block}
